home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 02 / 8 / DISK0285.ZIP / DETAB.BAS < prev    next >
BASIC Source File  |  1984-03-31  |  986b  |  33 lines

  1. 10   KEY OFF
  2. 30   CLS
  3. 40   PRINT "This program removes tabs from files"
  4. 45 REM
  5. 50     INPUT; "What is the name of the input file containing tabs: ",NM$
  6. 60     PRINT " "
  7. 70      OPEN NM$ FOR INPUT AS 2
  8. 80     INPUT; "What is the name of the output file: ",OUTNM1$
  9. 90     PRINT " "
  10. 100      IF NM$ <> OUTNM1$ THEN 120
  11. 110        PRINT "The output file must have a different filename" : GOTO 80
  12. 120      OPEN OUTNM1$ FOR OUTPUT AS 1
  13. 290 REM
  14. 300        WHILE ( NOT EOF(2) )
  15. 310           LINE INPUT# 2,INPFILE$
  16. 320 REM
  17. 360          HASTABS = INSTR(INPFILE$,CHR$(9))
  18. 370          WHILE HASTABS
  19. 380             BLANKFILL% = 9 - HASTABS MOD 8
  20. 390             IF BLANKFILL% = 9 THEN BLANKFILL% = 1
  21. 400             TEMP$ = MID$(INPFILE$,1,HASTABS-1)
  22. 410             TEMP$ = TEMP$ + SPACE$(BLANKFILL%)
  23. 420             INPFILE$ = TEMP$ + MID$(INPFILE$,HASTABS+1)
  24. 430             HASTABS = INSTR(INPFILE$,CHR$(9))
  25. 440          WEND
  26. 450 REM
  27. 470           PRINT #1,INPFILE$
  28. 480        WEND
  29. 485 REM
  30. 490     PRINT "detab completed"
  31. 500     CLOSE# 1,2
  32. 520 REM
  33.